package mysql_9_14;

import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;

public class ConnectDataBase {
	private static Properties file = new Properties();

	public static Connection connectDB() {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			InputStream in = ConnectDataBase.class.getResourceAsStream("\\url.properties");
			file.load(in);
			return DriverManager.getConnection(file.getProperty("url"), file.getProperty("name"),
					file.getProperty("password"));
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}

	}
}
